﻿/*
Commerce by Onex – eCommerce software platform (www.ecommerce.byonex.com)
Copyright (C) 2008-2010 by Onex Group

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 */
using System;
using System.Collections.Generic;
using System.Text;

namespace ShopModel
{
    /// <summary>
    /// Klasa przechowująca informacje o zdjeciu dodanym dla produktu (Class storing information about added photo for a given product)
    /// </summary>
    public class PictureInfo
    {
        #region VARIBLES

        private int productId;
        private int pictureId;
        private string name;
        private bool isMain;
        private PictureInfo miniature;
        private string directory;

        #endregion

        #region CONSTRUCTORS

        public PictureInfo()
        {
            productId = -1;
            pictureId = -1;
            name = string.Empty;
            isMain = false;
            miniature = null;
        }

        #endregion

        #region FIELDS

        public int ProductId
        {
            get { return productId; }
            set { productId = value; }
        }

        public int PictureId
        {
            get { return pictureId; }
            set { pictureId = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public bool IsMain
        {
            get { return isMain; }
            set { isMain = value; }
        }

        public PictureInfo Miniature
        {
            get { return miniature; }
            set { miniature = value; }
        }

        public string Directory
        {
            get { return directory; }
            set { directory = value; }
        }

        public string VirtualPath
        {
            get { return directory + "/" + name; }
        }

        public string Url
        {
            get { return directory.Substring(2) + "/" + name; }
        }
        #endregion
    }
}
